package com.vcredit.bird.util;

import com.vcredit.bird.vo.accumulation.AccParentParam;
import com.vcredit.creditcat.exception.BirdRequestException;
import com.vcredit.creditcat.exception.BirdRequestFailException;
import com.vcredit.framework.exception.BaseException;

public class ExceptionUtil {
	public static final String SUCCESSCODE = "0";
	public static final String ERRORCODE = "1";

	public static AccParentParam dealException(AccParentParam param) throws BirdRequestFailException, BaseException {
		if (param.getStatusCode().equals(SUCCESSCODE))
			return param;
		else if (param.getStatusCode().equals(ERRORCODE))
			throw new BirdRequestFailException(param.getStatusDescription());
		else
			throw new BirdRequestException("网络异常");
	}
}
